<template>
 <div class="article-comment">
    <!-- 全部评论 -->
    <van-sticky offset-top="11.73333vw">
      <div class="title van-hairline--bottom">
        <span>全部评论 ({{this.data.length}})</span>
        <span>0 点赞</span>
      </div>
    </van-sticky>
    <!-- 评论列表 -->
    <div class="list">
      <div class="item van-hairline--bottom" v-for="item in data" :key="item.com_id">
        <van-image round width="10vw" height="10vw" :src="item.aut_photo"/>
        <div class="info">
          <p>
            <span class="name">{{item.aut_name}}</span>
            <span class="zan">{{item.like_count}} <van-icon name="good-job-o" /></span>
          </p>
          <p class="cont">{{item.content}}</p>
          <p>
            <span class="reply">回复 <i class="van-icon van-icon-arrow"></i></span>
            <span class="time">{{item.pubdate}}</span>
          </p>
        </div>
      </div>
    </div>
 </div>
</template>
<script>

export default {
  name: 'ArticleComment',
  props: {
    data: {
      type: Array,
      required: true
    }
  }
}
</script>
<style scoped lang="less">
.article-comment {
  .title {
    height: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    background: #fff;
    span {
      font-size: 16px;
      &:last-child {
        color: #ccc;
        font-size: 14px;
      }
    }
  }
  .list {
    padding: 0 16px;
    .item {
      display: flex;
      padding: 10px 0;
      .info {
        padding-left: 10px;
        flex: 1;
        p {
          margin: 0;
          .name {
            font-size: 16px;
          }
          .zan {
            font-size: 14px;
            float: right;
            color: #999;
            .van-icon {
              font-size: 18px;
              position: relative;
              top: -1px;
            }
          }
          &.cont {
            font-size: 14px;
            color: #666;
            padding: 10px 0;
            word-break: break-all;
            padding-right: 40px;
          }
          .reply {
            min-width: 60px;
            height: 24px;
            text-align: center;
            line-height: 28px;
            font-size: 12px;
            display: inline-block;
            border-radius: 14px;
            color: #666;
            .van-icon {
              position: relative;
              top: 1px;
            }
          }
          .time {
            font-size: 12px;
            color: #999;
            margin-left: 10px;
          }
        }
      }
    }
  }
}
</style>
